package cn.buk.tms.factory;

import cn.buk.tms.entity.misc.OperationLog;

import static cn.buk.tms.common.constant.TmsOrderConstant.*;

public class OperationLogFactory {

    /**
     * 创建机票订单操作日志对象
     */
    public static OperationLog createFlightOrderOperationLog() {
        OperationLog o = new OperationLog();

        o.setObjectType(OPERATING_OBJECT_FLIGHT_ORDER);

        return o;
    }

    public static OperationLog createFlightCatchOrderOperationLog() {
        OperationLog o = new OperationLog();

        o.setObjectType(OPERATING_OBJECT_FLIGHT_CATCH_ORDER);

        return o;
    }

    public static OperationLog createFlightCharterOrderOperationLog() {
        OperationLog o = new OperationLog();

        o.setObjectType(OPERATING_OBJECT_FLIGHT_CHARTER_ORDER);

        return o;
    }

    /**
     * 创建账单操作日志对象
     */
    public static OperationLog createBillOperationLog() {
        OperationLog o = new OperationLog();

        o.setObjectType(OPERATING_OBJECT_BILL);

        return o;
    }

    /**
     * 创建账单操作日志对象
     */
    public static OperationLog createBillOperationLog(final int enterpriseId, final String username, final int billId, final String remark) {
        var log = createBillOperationLog();

        log.setEnterpriseId(enterpriseId);
        log.setOrderId(billId);
        log.setOperator(username);
        log.setContent(remark);

        return log;
    }

    public static OperationLog createFlightRefundOrderOperationLog() {
        OperationLog o = new OperationLog();
        o.setObjectType(OPERATING_OBJECT_FLIGHT_REFUND_ORDER);
        return o;
    }

    public static OperationLog createFlightChangeOrderOperationLog() {
        OperationLog o = new OperationLog();
        o.setObjectType(OPERATING_OBJECT_FLIGHT_CHANGE_ORDER);
        return o;
    }

    public static OperationLog createVasOrderOperationLog() {
        OperationLog o = new OperationLog();
        o.setObjectType(OPERATING_OBJECT_VAS_ORDER);
        return o;
    }

    public static OperationLog createHotelOrderLog() {
        OperationLog o = new OperationLog();
        o.setObjectType(OPERATING_OBJECT_HOTEL_ORDER);
        return o;
    }

    /**
     * 创建结算单日志
     */
    public static OperationLog createSettlementOperationLog() {
        OperationLog o = new OperationLog();
        o.setObjectType(OPERATING_OBJECT_SETTLEMENT);
        return o;
    }

    /**
     * 创建收款单日志
     */
    public static OperationLog createReceiptOperationLog() {
        OperationLog o = new OperationLog();
        o.setObjectType(OPERATING_OBJECT_RECEIPT);
        return o;
    }

    public static OperationLog createTrainOrderLog() {
        OperationLog o = new OperationLog();
        o.setObjectType(OPERATING_OBJECT_TRAIN_ORDER);
        return o;
    }

    public static OperationLog createTrainRefundOrderLog() {
        OperationLog o = new OperationLog();
        o.setObjectType(OPERATING_OBJECT_TRAIN_REFUND_ORDER);
        return o;
    }

    public static OperationLog createCarOrderLog() {
        OperationLog o = new OperationLog();
        o.setObjectType(OPERATING_OBJECT_CAR_ORDER);
        return o;
    }

    public static OperationLog createOperationLog(int enterpriseId, int ot) {
        OperationLog o = new OperationLog();
        o.setEnterpriseId(enterpriseId);
        o.setObjectType(ot);
        return o;
    }
}
